package com.city.itis.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.city.itis.dao.MemberDao;
import com.city.itis.domain.Member;
import com.city.itis.service.MemberService;

/**
 * 用户业务层实现类
 * @author WY
 *
 */
@Component("memberService")
public class MemberServiceImpl implements MemberService 
{
	private MemberDao memberDao;
	

	

	public MemberDao getMemberDao() 
	{
		return memberDao;
	}
	@Resource
	public void setMemberDao(MemberDao memberDao)
	{
		this.memberDao = memberDao;
	}

	@Override
	public int add(Member member)
	{
		return this.memberDao.save(member);
	}

	@Override
	public int delete(Member member) 
	{
		
		return memberDao.delete(member);
	}

	@Override
	public int deleteById(Integer id) 
	{
		return memberDao.deleteById(id);
	}

	@Override
	public int modify(Member member)
	{
		return memberDao.update(member);
	}

	@Override
	public Member getMemberById(Integer id) 
	{
		return memberDao.getMemberById(id);
	}
	
	@Override
	public Member getMemberByName(String name) 
	{
		return memberDao.getMemberByName(name);
	}
	
	@Override
	public Member getMemberByMemberId(String memberId) 
	{
		return this.memberDao.getMemberByMemberId(memberId);
	}

	@Override
	public List<Member> findAll() 
	{
		return memberDao.findAll();
	}
	@Override
	public int login(Integer id, String password)
	{
		return memberDao.login(id, password);
	}
	
	@Override
	public Member login(String memberId, String password) 
	{
		return memberDao.login(memberId, password);
	}


}
